package com.rongke.enums;

import java.io.File;

/**
 * 文件 <br>
 */
public enum FileType {

    /**
     * 检查记录
     */
    INSPECTION("检查记录", "inspection"),

    /**
     * 医生诊断书
     */
    REPORT("医生诊断书", "report"),

    /**
     * 手术记录
     */
    OPERATION("手术记录", "operation"),

    /**
     * 术后病理报告
     */
    PATHOLOGY("术后病理报告", "pathology"),

    /**
     * 化疗记录
     */
    CHEMOTHERAPY("化疗记录", "chemotherapy"),

    /**
     * 放疗记录
     */
    RADIOTHERAPY("放疗记录", "radiotherapy"),

    /**
     * 用户头像
     */
    USER_PIC("用户头像", "userPic");

    /**
     * 说明
     */
    private String desc;

    /**
     * 子路径
     */
    private String path;

    private String absolutePath;

    private String fileUrl;

    private FileType(String desc, String path) {
        this.desc = desc;
        this.path = path;

        String classRootPath = FileType.class.getClassLoader().getResource(".").getFile();
        File classFile = new File(classRootPath);
        this.absolutePath = classFile.getParentFile().getParent() + File.separator + "pic"
                            + File.separator + "medical" + File.separator + path;
        this.fileUrl = "/pic/medical/" + path;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getAbsolutePath() {
        return this.absolutePath;
    }

    public String getFileUrl() {
        return fileUrl;
    }

}